package com.livesource.client.webservices;

import com.livesource.client.model.entry.ProjectClass;
import com.livesource.client.model.project.Project;
import com.livesource.client.utilities.FileExtensions;
import com.livesource.client.webservices.github.RequestGithubFileContent;
import com.livesource.client.webservices.subversion.RequestSubversionFileContent;

public class GetFileContent {

	public GetFileContent(ProjectClass projectEntry, Project project) {

		if (FileExtensions.isTextFile(projectEntry.getFileExtension())) {

			if (Project.REPOSITORY_TYPE_SUBVERSION.equals(project
					.getRepositoryType())) {

				RequestSubversionFileContent.getJsonpRequest(project,
						projectEntry.toString());

			} else if (Project.REPOSITORY_TYPE_GITHUB.equals(project
					.getRepositoryType())) {

				RequestGithubFileContent.getJsonpRequest(project, projectEntry);

			}
		}
	}
}
